<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />

    <title>Service UI Fragment</title>
    <link href="../../static/css/cas.css" rel="stylesheet" th:remove="tag" />
</head>

<body>
    <main role="main" class="container mt-3 mb-3">
        <div th:fragment="serviceUI" th:if="${registeredService}" id="serviceui" class="mb-4">
            <div th:if="${serviceUIMetadata}" class="d-flex align-items-center p-2">
                <img th:if="${serviceUIMetadata.logoUrl}" th:title="${serviceUIMetadata.displayName}"
                    th:alt="${serviceUIMetadata.displayName}" th:src="${serviceUIMetadata.logoUrl}"
                    th:width="${serviceUIMetadata.logoWidth}" th:height="${serviceUIMetadata.logoHeight}" />

                <img th:unless="${serviceUIMetadata.logoUrl}" th:title="${serviceUIMetadata.displayName}"
                    th:alt="${serviceUIMetadata.displayName}" th:src="@{images/webapp.png}"
                    th:width="${serviceUIMetadata.logoWidth}" th:height="${serviceUIMetadata.logoHeight}" />
                <div class="ml-2">
                    <h2 th:text="${serviceUIMetadata.displayName}">serviceUIMetadata.displayName</h2>
                    <p th:text="${serviceUIMetadata.description}">serviceUIMetadata.description</p>

                    <p th:if="${serviceUIMetadata.informationURL}"
                        th:utext="#{screen.mdui.infolink.text(${serviceUIMetadata.informationURL})}">
                        screen.mdui.infolink.text</p>
                    <p th:if="${serviceUIMetadata.privacyStatementURL}"
                        th:utext="#{screen.mdui.privacylink.text(${serviceUIMetadata.privacyStatementURL})}">
                        serviceUIMetadata.privacyStatementURL</p>
                </div>
            </div>

            <div th:unless="${serviceUIMetadata}" class="d-flex align-items-center p-2">
                <img th:src="${registeredService.logo} ? ${registeredService.logo} : @{'images/webapp.png'}" />
                <div id="servicedesc" class="ml-2">
                    <h5 th:text="${registeredService.name}">Registered Service Name</h5>
                    <p th:text="${registeredService.description}">Registered Service Description</p>
                </div>
            </div>
        </div>
    </main>
</body>

</html>